package com.itheima.genericit;

public class GenericDemo4 {

    public static void main(String[] args) {
        String[] arr = {"hello", "world", "java"};
        Integer[] arr2 = {1, 2, 3, 4, 5};
        print(arr);
        System.out.println("-----------------------------");
        print(arr2);

    }

    // 泛型方法
    public static <T> void print(T[] arr) {
        for (T t : arr) {
            System.out.println(t);
        }
    }
}
